from django.shortcuts import render
from django.views.decorators import csrf
# from django.http import HttpResponse

def login(request):
    if request.method == 'POST':
        if request.POST:
            ctx = {
                'logininfo': {
                    'uname': request.POST['uname'],
                    'pwd': request.POST['pwd'],
                },
            }
            return render(request, 'login.html', ctx)
        else:
            return render(request, 'login.html', {'logininfo': 'Do not submit null value.'})
    elif request.method == 'GET':
        return render(request, 'login.html')
